package Boundry;

import Boundry.GenericTools.GenericTabel;
import Boundry.GenericTools.IPanelOperation;
import Boundry.GenericTools.InputPanel;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.ImageIcon;
import javax.swing.JTable;
import javax.swing.JComboBox;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import java.awt.Color;
import javax.swing.JTabbedPane;

import ServerOperation.GenricOperation;

public class NominateCommitteeAndInspectorPanel extends InputPanel implements IPanelOperation{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private GenericTabel table;
	private JComboBox comboBoxInspector;
	private JComboBox comboBoxMember1;
	private JComboBox comboBoxMember2;
	private JComboBox comboBoxChairMen;
	private GenericTabel genericTabel;
	private JPanel panel_2;
	private JTabbedPane tabbedPane;
	
	public NominateCommitteeAndInspectorPanel() {
		
		/*table = new JTable();
		table.setBounds(10, 32, 375, 162);
		panel.add(table);
		*/
		
		JPanel panel = new JPanel();
		panel.setBorder(new TitledBorder(null, "Step 1 : Choose Request", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel.setBounds(10, 11, 537, 357);
		mainPanel.add(panel);
		panel.setLayout(null);
		
		tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.setBounds(23, 21, 482, 258);
		panel.add(tabbedPane);
		table = new GenericTabel( 375, 162,"Requests to Nominate");
		tabbedPane.addTab("Requests to Nominate", null, table, null);
		
		panel_2 = new JPanel();
		tabbedPane.addTab("Requests to Renominate", null, panel_2, null);
		panel_2.setLayout(null);
		
		genericTabel = new GenericTabel(375, 162, "Requests to Nominate");
		genericTabel.setBounds(0, 0, 477, 230);
		panel_2.add(genericTabel);
		

		
		
		
		JPanel panel_1 = new JPanel();
		panel_1.setBorder(new TitledBorder(null, "Step 2 : Assign Inspector & Committee members", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		panel_1.setBounds(557, 11, 329, 199);
		mainPanel.add(panel_1);
		panel_1.setLayout(null);
		
		JLabel lblAddAs = new JLabel("Inspector:");
		lblAddAs.setBounds(30, 51, 76, 14);
		panel_1.add(lblAddAs);
		
		comboBoxInspector = new JComboBox();
		comboBoxInspector.setBounds(107, 48, 128, 20);
		panel_1.add(comboBoxInspector);
		
		
		
		
		JLabel lblMember = new JLabel("Member1:");
		lblMember.setBounds(28, 87, 64, 14);
		panel_1.add(lblMember);
		
		comboBoxMember1 = new JComboBox();
		comboBoxMember1.setBounds(107, 84, 128, 20);
		panel_1.add(comboBoxMember1);
		
		JLabel lblMember_1 = new JLabel("Member2:");
		lblMember_1.setBounds(30, 126, 65, 14);
		panel_1.add(lblMember_1);
		
		comboBoxMember2 = new JComboBox();
		comboBoxMember2.setBounds(107, 123, 128, 20);
		panel_1.add(comboBoxMember2);
		
		JLabel lblChairMen = new JLabel("Chair Men:");
		lblChairMen.setBounds(30, 164, 65, 14);
		panel_1.add(lblChairMen);
		
		comboBoxChairMen = new JComboBox();
		comboBoxChairMen.setBounds(107, 161, 128, 20);
		panel_1.add(comboBoxChairMen);
		
		JLabel lblIeList = new JLabel("IE List");
		lblIeList.setForeground(Color.RED);
		lblIeList.setBounds(259, 87, 46, 14);
		panel_1.add(lblIeList);
	}
	public JTabbedPane getTabbedPane() {
		return tabbedPane;
	}
	public void setTabbedPane(JTabbedPane tabbedPane) {
		this.tabbedPane = tabbedPane;
	}
	public GenericTabel getGenericTabel() {
		return genericTabel;
	}
	public void setGenericTabel(GenericTabel genericTabel) {
		this.genericTabel = genericTabel;
	}
	public JPanel getPanel_2() {
		return panel_2;
	}
	public void setPanel_2(JPanel panel_2) {
		this.panel_2 = panel_2;
	}
	public GenericTabel getTable() {
		return this.table;
	}
	public void setTable(GenericTabel table) {
		this.table = table;
	}
	public JComboBox getComboBoxInspector() {
		return comboBoxInspector;
	}
	public void setComboBoxInspector(JComboBox comboBoxInspector) {
		this.comboBoxInspector = comboBoxInspector;
	}
	public JComboBox getComboBoxMember1() {
		return comboBoxMember1;
	}
	public void setComboBoxMember1(JComboBox comboBoxMember1) {
		this.comboBoxMember1 = comboBoxMember1;
	}
	public JComboBox getComboBoxMember2() {
		return comboBoxMember2;
	}
	public void setComboBoxMember2(JComboBox comboBoxMember2) {
		this.comboBoxMember2 = comboBoxMember2;
	}
	public JComboBox getComboBoxChairMen() {
		return comboBoxChairMen;
	}
	public void setComboBoxChairMen(JComboBox comboBoxChairMen) {
		this.comboBoxChairMen = comboBoxChairMen;
	}
	@Override
	public String apHelpButton() {
		// TODO Auto-generated method stub
		return "In this screen you need to choose request and then nominate commite members";
	}
	
	
	
	public void buildTabel(String[] columnNames, String[][] tableData)
	{   
		table.buildTabel( columnNames,  tableData);
	}
	public void buildTabel2(String[] columnNames, String[][] tableData)
	{   
		genericTabel.buildTabel( columnNames,  tableData);
	}
	public void addRow(String[] row)
	{
		table.addRow( row);
		
	}
	
	public void addColumn(String colName)
	{
		table.addColumn(colName);
	}
	
	public void removeRow(int rowLineNumber)
	{
		table.removeRow(rowLineNumber);
	}
	
	public void removeAllRows()
	{
		table.removeAllRows();
	}
	
    public boolean isChosen() 
    {
    	return ( table.isChosen() || genericTabel.isChosen() );
    }
    
    public int getChosen()
    {
    	 return table.getChosen() ;
    }
    public int getChosen2()
    {
    	 return genericTabel.getChosen() ;
    }
	public void addItemToComboBoxInspector(String item){
		this.comboBoxInspector.addItem(item);
	}
	public void addItemToComboBoxCommitte1(String item){
		this.comboBoxMember1.addItem(item);
	}
	public void addItemToComboBoxCommitte2(String item){
		this.comboBoxMember2.addItem(item);
	}
	public void addItemToComboBoxChairMen(String item){
		this.comboBoxChairMen.addItem(item);
	}
	public void removeItemFromComboBoxCom1(String item){
		this.comboBoxMember1.removeItem(item);
	}
	public void removeItemFromComboBoxCom2(String item){
	this.comboBoxMember2.removeItem(item);
	}
	@Override
	public String setTitle() {
		return "Assign Committe members and Inspector" ;
	}
}
